var BabyObj = function () {
	this.x;
	this.y;
	this.angle;

	this.babyTailTimer;
	this.babyTailCount;

	this.babyEyeTimer;
	this.babyEyeCount;
	this.babyEyeInterval;

	this.babyFadeTimer;
	this.babyFadeCount;
	this.babyFadeInterval;
}
BabyObj.prototype.init = function (){
	this.x = 0.5 * can_w + 50;
	this.y = 0.5 * can_h + 50;
	this.angle = 0;


	this.babyTailTimer = 0;
	this.babyTailCount = 0;

	this.babyEyeTimer = 0;
	this.babyEyeCount = 0;
	this.babyEyeInterval = 1000;

	this.babyFadeTimer = 0;
	this.babyFadeCount = 0;
	this.babyFadeInterval = 0;

}
BabyObj.prototype.draw = function () {
	this.x = lerpDistance( mom.x +30, this.x, 0.985);
	this.y =  lerpDistance( mom.y +30, this.y, 0.985);
	var deltaX = mom.x - this.x;
	var deltaY = mom.y - this.y; 
	var beta = Math.atan2( deltaY, deltaX ) + Math.PI;
	this.angle = lerpAngle( beta, this.angle, 0.8);

	//babyTail timer
	this.babyTailTimer += deltaTime;
	if(this.babyTailTimer > 50){
		this.babyTailCount = ( this.babyTailCount +1 ) % 8;
		this.babyTailTimer %= 50;
	}

	//babyEye
	this.babyEyeTimer += deltaTime;
	if(this.babyEyeTimer > this.babyEyeInterval){
		this.babyEyeCount = ( this.babyEyeCount + 1 ) % 2;
		this.babyEyeTimer %= this.babyEyeInterval;
		if( this.babyEyeCount == 0 ){
			this.babyEyeInterval = Math.random() * 1500 + 2000;
		}else{
			this.babyEyeInterval = 200;
		}
	}

	//babyFade
	this.babyFadeTimer += deltaTime;
	if( this.babyFadeTimer > 200 ){
		this.babyFadeCount++;
		this.babyFadeTimer %= 200;
		if( this.babyFadeCount > 19){
			this.babyFadeCount = 19;
			data.gameover = true;
		}
	}
	ctx1.save();
	ctx1.translate( this.x, this.y);
	ctx1.rotate(this.angle);

	var babyTailCount = this.babyTailCount;
	ctx1.drawImage( babyTail[babyTailCount], -babyTail[babyTailCount].width * 0.5 +25, -babyTail[babyTailCount].height * 0.5);
	
	var babyFadeCount = this.babyFadeCount;
	ctx1.drawImage( babyFade[babyFadeCount],  -babyFade[babyFadeCount].width * 0.5, -babyFade[babyFadeCount].height * 0.5);
	
	var babyEyeCount = this.babyEyeCount;
	ctx1.drawImage( babyEye[babyEyeCount], -babyEye[babyEyeCount].width * 0.5, -babyEye[babyEyeCount].height * 0.5);
	ctx1.restore();
};

BabyObj.prototype.recover = function() {
	this.babyFadeCount = 0;
};